<h1>Sửa khách hàng</h1>

<?php echo $this->Form->create('Customer', array('action' => 'edit', $this->data['Customer']['id'])); ?>
<?php echo $this->Form->input('Customer.id', array('type' => 'hidden')); ?>
<table class="table2">
    <tr>
        <td>Họ và tên đệm <span class="compulsory">*</span></td>
        <td>
            <?php echo $this->Form->input('Customer.last_name', array('type' => 'text', 'class' => 'textfield', 'label' => false)); ?>
        </td>
    </tr>
    <tr>
        <td>Tên <span class="compulsory">*</span></td>
        <td>
            <?php echo $this->Form->input('Customer.first_name', array('type' => 'text', 'class' => 'textfield', 'label' => false)); ?>
        </td>
    </tr>
    <tr>
        <td>ĐT <span class="compulsory">*</span></td>
        <td><?php echo $this->Form->input('Customer.telephone', array('type' => 'text', 'class' => 'textfield', 'label' => false)); ?></td>
    </tr>
    <tr>
        <td>Email <span class="compulsory">*</span></td>
        <td><?php echo $this->Form->input('Customer.email', array('type' => 'text', 'class' => 'textfield', 'label' => false)); ?></td>
    </tr>
    <tr>
        <td>Địa chỉ <span class="compulsory">*</span></td>
        <td><?php echo $this->Form->input('Customer.address', array('type' => 'text', 'class' => 'textfield', 'label' => false)); ?></td>
    </tr>
    <tr>
        <td>Mã khách</td>
        <td>
            <?php echo $this->Form->input('Customer.code', array('type' => 'hidden', 'class' => 'textfield', 'label' => false)); ?>
            <?php //echo $this->element('barcode', array('data_to_encode' => $customer_code)); ?>
            <span class="code"><?php echo $this->data['Customer']['code']; ?></span>
        </td>
    </tr>
    <tr>
        <td>&nbsp;</td>
        <td>
            <?php echo $this->Form->submit('Sửa', array('class' => 'button', 'div' => false)); ?>
            <?php echo $this->Form->submit('Hủy', array('class' => 'button', 'onclick' => "return back_to_index()", 'div' => false)); ?>
            <script type="text/javascript">
            function back_to_index()
            {
                window.location = '<?php echo $this->Html->url(array('controller' => 'customers', 'action' => 'index')) ?>';
                return false;
            }
            </script>
        </td>
    </tr>
</table>
<?php echo $this->Form->end(); ?>